<%@ include file="/WEB-INF/jsp/common/include.jsp"
    %><%@ page pageEncoding="UTF-8"
    %><%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"
    %><%@ taglib prefix="app" uri="AppTags"
    %><%@ page import="com.google.appengine.api.users.*"
    %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page import="java.util.Enumeration"%><html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <c:choose>
    <c:when test="${empty requestScope.city}">
      <c:set var="city" value="minsk"/>
    </c:when>
    <c:otherwise>
      <c:set var="city" value="${requestScope.city}"/>
    </c:otherwise>
  </c:choose>
  <c:set var="pageMessageKey">
    <tiles:getAsString name="pageMessageKey" ignore="true"/>
  </c:set>
  <meta name="keywords" content='<spring:message code="keywords.${pageMessageKey}.${city}" />'/>
  <meta name="description" content='<spring:message code="description.${pageMessageKey}.${city}" />'/>
  <meta name='yandex-verification' content='79757b6975b34098' />
  <meta name='yandex-verification' content='6f33d95218953def' />
  <meta name='yandex-verification' content='6a6bbe1c7ed82556' />
  <meta name='yandex-verification' content='5d331931513da689' />
  <meta name="google-site-verification" content="GaY0EnOXbQnWcwtSf3Fuwbr6XsIn4yVtXvkkZCxXSI8" />
  <tiles:importAttribute name="pageTitle" ignore="true"/>
  <title><c:choose>
    <c:when test="${empty pageTitle}"><spring:message code="title.${pageMessageKey}.${city}" text=""/></c:when>
    <c:otherwise>${pageTitle}</c:otherwise></c:choose></title>
  <link href="/image/favicon-2.ico" rel="shortcut icon">
  <link rel="stylesheet" type="text/css" href="<app:slaveServerUrl />/css/layout.css">
  <link rel="stylesheet" type="text/css" href="<app:slaveServerUrl />/css/common.css">
  <link rel="stylesheet" type="text/css" href="<app:slaveServerUrl />/css/search.css">
  <link rel="stylesheet" type="text/css" href="<app:slaveServerUrl />/css/add.css">
  <link rel="stylesheet" type="text/css" href="<app:slaveServerUrl />/css/jquery/jquery.autocomplete.css"/>
  <link rel="stylesheet" type="text/css" href="<app:slaveServerUrl />/js/jquery/plugins/tools/scrollable/scrollable-horizontal.css"/>
  <link rel="stylesheet" type="text/css" href="<app:slaveServerUrl />/js/jquery/plugins/tools/scrollable/scrollable-buttons.css"/>
  <link rel="stylesheet" type="text/css" href="<app:slaveServerUrl />/js/jquery/plugins/superbox/jquery.superbox.css"/>
  <link rel="alternate" type="application/rss+xml" title="RSS" href="/ad/search/long/rss.do?accept=xml" />
  <!--     <script type="text/javascript" -->
  <!--         src="http://www.google.com/jsapi"></script> -->
  <!--     <script type="text/javascript">
         google.load("jquery", "1.11.1");
  </script> -->
  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.js"></script>
  <script src="http://cdn.jquerytools.org/1.2.7/full/jquery.tools.min.js"></script>
  <%--     <script type="text/javascript" src="<app:slaveServerUrl />/js/jquery/plugins/superbox/jquery.superbox.js"></script> --%>
  <!-- script src="/js/jquery/jquery-1.3.2.js"></script -->
  <script type="text/javascript">
    /* Выбор города и комнат*/
    $(document).ready(function(){
      $('#cityChange select[name="city"]').change(function(){
        var value = $(this).val();
        $('#cityChange .link').text( $('option[value="'+value+'"]', this).text() );
      });
      $('#roomChange select[name="room"]').change(function(){
        var value = $(this).val();
        $('#roomChange .link').text( $('option[value="'+value+'"]', this).text() );
      });
      $('select').css({'opacity':0});
    });
  </script>

</head>
<body>
<!--Background-->
<div id="bg" class="summer">
  <div class="hbg">
    <div class="picture"></div>
  </div>
</div>
<!--Background-->

<div id="layout">
  <div class="container">
    <ul class="extra-menu">

      <%
        UserService userService = UserServiceFactory.getUserService();
        if (!userService.isUserLoggedIn()) {
      %>
      <li><a href="<%= userService.createLoginURL("/?loggedIn=true") %>">Войти</a></li>
      <script type="text/JavaScript">
        var loggedIn = false;
        var loginUrl = '<%= userService.createLoginURL("")%>';
      </script>
      <% } else { %>
      <li><a href="#"><%= userService.getCurrentUser().getNickname() %></a></li>
      <li><a href="<%= userService.createLogoutURL("/") %>">Выйти</a></li>
      <script type="text/JavaScript">
        var loggedIn = true;
      </script>
      <%
        }
      %>
      <li><a href="https://play.google.com/store/apps/details?id=com.hatuby.customer">Android</a></li>
      <li><a href="/more/about.do">О нас</a></li>
      <li><a href="/more/partners.do">Партнёры</a></li>
      <li><a href="/ad/search/long/rss.do?accept=xml">RSS</a></li>
    </ul>
    <!--Header-->
    <div class="header">
      <div class="menu white-box">
        <h1>
          Я хочу
          <span class="tab <tiles:getAsString name='searchTab' ignore='true'/>"><a class="psevdo" href="/">снять</a><span class="s l"></span><span class="s r"></span></span>
          <span class="tab <tiles:getAsString name='addTab' ignore='true'/>"><a class="psevdo" href="/ad/add/addFlat.do">сдать</a><span class="s l"></span><span class="s r"></span></span>
          квартиру
        </h1>
        <a href="/"><img class="logo"  alt="хату.бы" src="<app:slaveServerUrl />/image/logo.png" /></a>
      </div>
    </div>
    <!--Header-->
    <!--Content-->
    <div class="content">
      <tiles:insertAttribute name="body">
      </tiles:insertAttribute>
    </div>
  </div>
</div>
<jsp:include page="counter.jsp"/>
</body>

</html>